package com.gongyi.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @Classname User
 * @Description TODO
 * @Date 2022/1/7 8:57
 * @Created by Administrator
 */
//等价于<bean id="user" class="com.gongyi.pojo.User"/>
//@Component组件
@Component
@Scope("singleton")
public class User {
    // 相当于<property name="name" value="gongyi"/>
    @Value("gongyi")
    public String name;
    //@Value("muzi")
    public void setName(String name) {
        this.name = name;
    }
}
